package com.graduation.springbootinit.model.entity.ShopPart;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@TableName(value = "shop_part_conversations")
@Data
public class Conversation implements Serializable {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private Long userId;
    
    private String userName;
    
    private Long storeId;
    
    private String storeName;
    
    private String lastMessage;
    
    private Date lastMessageTime;
    
    private Integer userUnreadCount;
    
    private Integer storeUnreadCount;
    
    @TableField(fill = FieldFill.INSERT)
    private Date createdAt;
    
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedAt;
    
    @TableField(exist = false)
    private List<Message> userMessages;
    
    @TableField(exist = false)
    private List<Message> storeMessages;
    
    @TableField(exist = false)
    private List<Message> allMessages;
    
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}